<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="st" tagdir="/WEB-INF/tags" %>
<%@taglib prefix="j" uri="j/tags" %>
<%@ taglib prefix="easyui" uri="http://www.joyi.cn/easyui/tags" %>

<st:page title="用户管理">
    <div data-options="region:'west',title:'分类管理',split:true" style="width:260px;">
        <div id="ucToolbar">
            <easyui:linkButton name="增加用户分类" iconKey="add" onClick="addUc()"/>
        </div>

        <table id="tt" class="easyui-treegrid"
               data-options="url:'/user/req?rid=<j:des data="20151012000000000004"/>',fit:true,idField:'id',treeField:'name'">
            <thead>
            <tr>
                <th data-options="field:'name',width:180">分类列表</th>
                <th data-options="field:'id',formatter:callbackFunc,width:100">操作</th>
            </tr>
            </thead>
        </table>
    </div>
    <div data-options="region:'center',title:'用户管理'" style="padding:5px;background:#ffab3f;"></div>

    <script>
        function callbackFunc(value, row, index) {
            var cz = '';
            cz = "<a href='javascript:viod(0);' onclick='edit(\"" + row["id"] + "\")'";
            cz += ">修改</a>";
            cz += " <a href='javascript:void(0);' onclick='delUc(\"" + value + "\")'";
            cz += ">删除</a>";
            return cz;
        }

        function addUc(){
            j.open("/user/pd?act=jsp&jsp=<j:des data="moloch/editUserCategory"/>",
                    "editWin",{},300,280);
        }

        function reloadUserCategoryData(){
            $("#tt").treegrid("reload");
        }

    </script>
</st:page>
